package com.baizhi.cmfz.controller;

import com.baizhi.cmfz.annotation.LogAnnotation;
import com.baizhi.cmfz.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/user")
public class UserController {

	@Autowired
	private UserService userService;

	@LogAnnotation(value = "分页查询用户信息",type = "select")
	@RequestMapping("/selectUserPage")
	public Map selectUserPage(int page,int limit,String  name){
		return userService.selectUserPage(page, limit, name);
	}


	@LogAnnotation(value = "封号",type = "update")
	@RequestMapping("/userUpdate")
	public Map userUpdate(int userId,int userStatus){
		return userService.userUpdate(userId,userStatus);
	}



	@LogAnnotation(value = "查询用户的统计信息",type = "select")
	@RequestMapping("/selectUserDTO")
	public Map selectUserDTO(){
		Map map = userService.selectUser();
		return map;
	}
}
